package com.example;

import com.example.demo.OrgUnit;

import java.util.Comparator;

public class OrgComparator implements Comparator<OrgUnit> {


    @Override
    public int compare(OrgUnit o1, OrgUnit o2) {
        if(o1.getAge()== o2.getAge()){
            return 1;
        }
        if(o1.getAge()<o2.getAge()){
            return -1;
        }else {
            return 1;
        }
    }
}
